package demo_10_11_01;

import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.Scanner;

public class work_03 {
    public static void main(String[] args) {
        String str ="aabbcc";
        String str1 = "abcabc";
        byte[] by=str.getBytes(Charset.defaultCharset());//把字符串变成数组
        byte[] by1=str.getBytes(Charset.defaultCharset());
        Arrays.sort(by);//排序
        Arrays.sort(by1);
        if (Arrays.equals(by,by1)){
            System.out.println("字符串一致");
        }else {
            System.out.println("字符串不一致");
        }

    }
}
 class Chapter03 {
//    public static void main(String[] args) {

     {
         Scanner s = new Scanner(System.in);
        System.out.println("请输入第一个字符串");
        String a = s.next();
        System.out.println("请输入第二个字符串");
        String b = s.next();
        int a1 = a.length();
        System.out.println(a1);
        int b1 = b.length();
        for (int l=0;l<=a1;l++) {
            for (int i = 0; i <=b1; i++) {
                if (a.substring(l).equals(b.substring(i))) {//提取数组a和数组b中每一个字符相比较
                    System.out.println("两个字符串包含同样的字符");

                }else{
                    System.out.println("两个字符串不包含同样的字符，不相等");
                }
            }
        }
    }
}
